10 CLS : LOCATE 9, 10
20 PRINT "1) USER TO GUESS COMPUTER'S WORD"
30 PRINT TAB(10); "2) ONE PLAYER TO GUESS ANOTHER PLAYER'S WORD"
40 PRINT TAB(10); "3) EXIT PROGRAM"
50 PRINT TAB(10); "   ENTER SELECTION "
60 PICK$ = INKEY$: IF PICK$ = "" THEN 60
70 P = VAL(PICK$): IF P < 1 OR P > 3 THEN 10
80 ON P GOSUB 100, 200, 999
90 GOTO 10
100 REM
110 REM**** WORD INPUT BY COMPUTER ****
120 REM
130 RANDOMIZE TIMER: RESTORE
140 FOR I = 1 TO INT(RND * 30 + 1)
150    READ WORD$
160 NEXT I
170 GOSUB 400
180 RETURN
200 REM
210 REM**** WORD ENTERED BY PLAYER ONE ****
220 REM
230 PRINT "TYPE IN A WORD, FOLLOWED IMMEDIATELY BY AN ASTERISK (*)"
240 WORD$ = "": T$ = ""
250 WHILE T$ <> "*"
260    T$ = INKEY$: IF T$ = "" THEN 260
270    WORD$ = WORD$ + T$
280    PRINT "*";
290 WEND
300 WORD$ = LEFT$(WORD$, LEN(WORD$) - 1)
310 GOSUB 400
320 RETURN
400 REM
410 REM**** GUESS ROUTINE ****
420 REM
430 CLS : LOCATE 6, 10
440 L = LEN(WORD$): G = 1
450 PRINT "THE WORD HAS"; L; "LETTERS"
460 LOCATE 10, 10
470 GUESS$ = STRING$(L, 221)
480 PRINT GUESS$
490 WHILE G < 11
500      LOCATE 18, 10: PRINT "THIS IS GUESS #"; G; "OF 10"
510      LOCATE 19, 10: INPUT "GUESS A LETTER"; G$
520      FOR J = 1 TO L
530         IF MID$(WORD$, J, 1) <> G$ THEN 550 ELSE MID$(GUESS$, J, 1) = G$
540         LOCATE 10, 10: PRINT GUESS$
550      NEXT J
560      G = G + 1
570      IF GUESS$ = WORD$ THEN G = 11
580 WEND
590 LOCATE 14, 10
600 IF GUESS$ = WORD$ THEN PRINT " Y O U  W I N " ELSE PRINT "YOU LOSE...THE WORD WAS "; WORD$
610 FOR I = 1 TO 3000: NEXT I: REM DELAY
620 RETURN
700 REM
710 REM**** PROGRAM DATA ****
720 REM
730 DATA COMPUTER, DISKETTE, BYTE, BINARY, STRING, GRAPHICS
740 DATA VARIABLE, SUBROUTINE, FUNCTION, NUMERIC, LETTER, MONITOR
750 DATA PROGRAM, LOOPS, SYNTAX, ERRORS, TESTING, MOUSE
760 DATA KEYBOARD, CONTROL, GAMES, GUESS, DELETE, ENTER, DISPLAY
770 DATA PRINTER, DRIVES, HARDWARE, SOFTWARE, MODEM
999 REM
1000 REM**** PROGRAM EXIT ROUTINE ****
1010 REM
1020 CLS
1030 END




